package cn.sypt.yuhao.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.ws.rs.core.Application;

import cn.itcast.servlet.BaseServlet;
import cn.sypt.yuhao.dao.CategoryDao;
import cn.sypt.yuhao.dao.VideoDao;
import cn.sypt.yuhao.domain.Category;

public class CategoryServlet extends BaseServlet {
	private CategoryDao cd=new CategoryDao();
	private VideoDao vd=new VideoDao();
	public String findAll(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		List<Category> list=cd.findAll();
		request.getSession().setAttribute("list", list);
		request.setAttribute("video1", vd.findByhot());
		request.setAttribute("video2", vd.findBynew());
		request.setAttribute("video3", vd.findBydow());
		return "f:/ui/index.jsp";
	}

}
